package com.wenyu.wenyuyuedu.index;

/**
 * Created by sunxiquan on 2017/3/13.
 */

import java.util.Comparator;

/**
 * 拼音排序接口：用来对ListView里面的数据根据ABCDEFG...来排序
 *
 * @author owen
 */
public class PinyinComparator implements Comparator<User> {

    @Override
    public int compare(User cta1, User cta2) {

        if (cta1.getFirstLetter().equals("#")) {
            return 1;
        } else if (cta2.getFirstLetter().equals("#")) {
            return -1;
        } else {
            return cta1.getFirstLetter().compareTo(cta2.getFirstLetter());
        }
    }

}
